<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:76:"D:\phpstudy_pro\WWW\nmg002\public/../application/admin\view\login\login.html";i:1673748845;}*/ ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/public/static/favicon.ico">
    <link href="/public/static/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css" rel="stylesheet">
    <link href="/public/static/admin/css/login.css" rel="stylesheet">
    <link href="/public/static/admin/layui/css/layui.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>
</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-12">
                <form method="post" action="">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md"><?php echo $setting['school_name']; ?></p>
                    <input type="text" class="form-control uname" name="username" id="username" placeholder="用户名" />
                    <input type="password" class="form-control pword m-b" name="password" id="password" placeholder="密码" />
                    <button type="button" class="btn btn-success btn-block" id="submit">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; <?php echo $setting['school_name']; ?>
            </div>
        </div>
    </div>
</body>

<script src="/public/static/admin/js/jquery.min.js"></script>
<script src="/public/static/admin/layui/layui.js"></script>
<script>
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        //点击提交
        $("#submit").click(function(){
            $.post("<?php echo url('Login/tologin'); ?>",{username:$("#username").val(),password:$("#password").val()},function(data){
                    // for(k in data){
                    //     alert(k+"+"+data[k])
                    // }
                   top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                        if(data.url){
                            window.location.href = data.url;
                        }
                    });

            })
        });
    });
    document.onkeydown = function (event) {
        var e = event || window.event;
        if (e && e.keyCode == 13) { //回车键的键值为13
            $("#submit").click(); //调用登录按钮的登录事件
        }
    };
</script>

</html>
